﻿using System;
using System.Collections.Generic;
using System.Text;

using RaisingStudio.Data;
using RaisingStudio.Data.Common;
using RaisingStudio.Data.Expressions;
using RaisingStudio.Data.Common.Builders.Expressions;

namespace RaisingStudio.Data.Providers.Adapters.Generic
{
    /// <summary>
    /// datatable DataAdapter.
    /// </summary>
    public class DataTableAdapter<T> where T : System.Data.DataTable
    {
        #region Common property 
        protected RaisingStudio.Data.Providers.Adapters.DataTableAdapter adapter;
        /// <summary>
        /// datatable DataAdapter.
        /// </summary>
        public RaisingStudio.Data.Providers.Adapters.DataTableAdapter Adapter
        {
            get
            {
                return this.adapter;
            }
        }

        /// <summary>
        /// datatable Type.
        /// </summary>
        public System.Type DataTableType
        {
            get
            {
                return Adapter.DataTableType;
            }
        }

        /// <summary>
        /// database connection.
        /// </summary>
        public System.Data.IDbConnection Connection
        {
            get
            {
                return Adapter.Connection;
            }
        }

        /// <summary>
        /// database transaction manager.
        /// </summary>
        public TransactionManager TransactionManager
        {
            get
            {
                return Adapter.TransactionManager;
            }
        }

        /// <summary>
        /// Command builder.
        /// </summary>
        public RaisingStudio.Data.Common.Builders.CommandBuilder CommandBuilder
        {
            get
            {
                return Adapter.CommandBuilder;
            }
        }

        /// <summary>
        /// default Data table mapping.
        /// </summary>
        public System.Data.Common.DataTableMapping DefaultDataTableMapping
        {
            get
            {
                return Adapter.DefaultDataTableMapping;
            }
        }
        #endregion

        #region Constructor
        public DataTableAdapter(DataTableAdapter adapter)
        {
            this.adapter = adapter;
        }

        /// <summary>
        /// Constructor
        /// </summary>
        public DataTableAdapter()
        {
            this.adapter = new DataTableAdapter(typeof(T));
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="connection">database connection.</param>
        public DataTableAdapter(System.Data.IDbConnection connection)
        {
            this.adapter = new DataTableAdapter(typeof(T), connection);
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="transactionManager">database transaction manager.</param>
        public DataTableAdapter(TransactionManager transactionManager, ILogManager logManager)
        {
            this.adapter = new DataTableAdapter(typeof(T), transactionManager, logManager);
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="definitionName">object definition name.</param>
        public DataTableAdapter(string definitionName)
        {
            this.adapter = new DataTableAdapter(typeof(T), definitionName);
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="definitionName">object definition name.</param>
        /// <param name="connection">database connection.</param>
        public DataTableAdapter(string definitionName, System.Data.IDbConnection connection)
        {
            this.adapter = new DataTableAdapter(typeof(T), definitionName, connection);
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="definitionName">object definition name.</param>
        /// <param name="transactionManager">database transaction manager.</param>
        public DataTableAdapter(string definitionName, TransactionManager transactionManager, ILogManager logManager)
        {
            this.adapter = new DataTableAdapter(typeof(T), definitionName, transactionManager, logManager);
        }
        #endregion

        #region Transactions
        /// <summary>
        /// Begin Database transaction.
        /// </summary>
        /// <returns>The ID of transaction.</returns>
        public virtual string BeginTransaction()
        {
            return this.adapter.BeginTransaction();
        }

        /// <summary>
        /// Begin Database transaction.
        /// </summary>
        /// <param name="isolationLevel">Specifies the isolation level for the transaction.</param>
        /// <returns>The ID of transaction.</returns>
        public virtual string BeginTransaction(System.Data.IsolationLevel isolationLevel)
        {
            return this.adapter.BeginTransaction(isolationLevel);
        }

        /// <summary>
        /// Commit Database transaction.
        /// </summary>
        public virtual void CommitTransaction()
        {
            this.adapter.CommitTransaction();
        }

        /// <summary>
        /// Commit Database transaction.
        /// </summary>
        /// <param name="transactionID">The ID of transaction.</param>
        public virtual void CommitTransaction(string transactionID)
        {
            this.adapter.CommitTransaction(transactionID);
        }

        /// <summary>
        /// Rollback transaction.
        /// </summary>
        public virtual void RollbackTransaction()
        {
            this.adapter.RollbackTransaction();
        }

        /// <summary>
        /// Rollback transaction.
        /// </summary>
        /// <param name="transactionID">The ID of transaction.</param>
        public virtual void RollbackTransaction(string transactionID)
        {
            this.adapter.RollbackTransaction(transactionID);
        }
        #endregion

        #region Common Methods
        #region Base Function 
        /// <summary>
        /// Execute SQL command.
        /// </summary>
        /// <param name="commonCommand">Command.</param>
        /// <returns>The number of rows affected.</returns>
        public virtual int ExecuteNonQueryCommand(CommonCommand commonCommand)
        {
            return this.adapter.ExecuteNonQueryCommand(commonCommand);
        }

        /// <summary>
        /// Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
        /// </summary>
        /// <param name="commonCommand">Command.</param>
        /// <returns>The first column of the first row in the result set, or a null reference (Nothing in Visual Basic) if the result set is empty.</returns>
        public virtual object ExecuteScalarCommand(CommonCommand commonCommand)
        {
            return this.adapter.ExecuteScalarCommand(commonCommand);
        }

        /// <summary>
        /// Execute the Command to the Connection and builds a DbDataReader.
        /// </summary>
        /// <param name="commonCommand">Command.</param>
        /// <returns>A DbDataReader object.</returns>
        public virtual System.Data.IDataReader ExecuteReaderCommand(CommonCommand commonCommand)
        {
            return this.adapter.ExecuteReaderCommand(commonCommand);
        }
        #endregion

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable)
        {
            return this.adapter.Fill(dataTable);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, string[] columnNames)
        {
            return this.adapter.Fill(dataTable, columnNames);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, CommonCommand conditionCommand)
        {
            return this.adapter.Fill(dataTable, conditionCommand);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, string[] columnNames, CommonCommand conditionCommand)
        {
            return this.adapter.Fill(dataTable, columnNames, conditionCommand);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, object[] primaryKeys)
        {
            return this.adapter.Fill(dataTable, primaryKeys);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, object[] primaryKeys, string[] columnNames)
        {
            return this.adapter.Fill(dataTable, primaryKeys, columnNames);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <returns>Datatable.</returns>
        public virtual T GetData()
        {
            return (T)this.adapter.GetData();
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(string[] columnNames)
        {
            return (T)this.adapter.GetData(columnNames);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(CommonCommand conditionCommand)
        {
            return (T)this.adapter.GetData(conditionCommand);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(string[] columnNames, CommonCommand conditionCommand)
        {
            return (T)this.adapter.GetData(columnNames, conditionCommand);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(object[] primaryKeys)
        {
            return (T)this.adapter.GetData(primaryKeys);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(object[] primaryKeys, string[] columnNames)
        {
            return (T)this.adapter.GetData(primaryKeys, columnNames);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable)
        {
            return this.adapter.Update(dataTable);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, string[] columnNames)
        {
            return this.adapter.Update(dataTable, columnNames);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows)
        {
            return this.adapter.Update(dataRows);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, string[] columnNames)
        {
            return this.adapter.Update(dataRows, columnNames);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow)
        {
            return this.adapter.Update(dataRow);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, string[] columnNames)
        {
            return this.adapter.Update(dataRow, columnNames);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(object[] primaryKeys)
        {
            return this.adapter.Delete(primaryKeys);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="originalValues">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(string[] columnNames, object[] originalValues)
        {
            return this.adapter.Delete(columnNames, originalValues);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="originalValues">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(Dictionary<string, object> originalValues)
        {
            return this.adapter.Delete(originalValues);
        }

        /// <summary>
        /// Delete the data according the condition.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(CommonCommand conditionCommand)
        {
            return this.adapter.Delete(conditionCommand);
        }

        /// <summary>
        /// Delete all data.
        /// </summary>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete()
        {
            return this.adapter.Delete();
        }

        /// <summary>
        /// Insert data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Insert(object[] values)
        {
            return this.adapter.Insert(values);
        }

        /// <summary>
        /// Insert data.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Insert(string[] columnNames, object[] values)
        {
            return this.adapter.Insert(columnNames, values);
        }

        /// <summary>
        /// Insert data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Insert(Dictionary<string, object> values)
        {
            return this.adapter.Insert(values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] values)
        {
            return this.adapter.Update(values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(string[] columnNames, object[] values)
        {
            return this.adapter.Update(columnNames, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(Dictionary<string, object> values)
        {
            return this.adapter.Update(values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] primaryKeys, object[] values)
        {
            return this.adapter.Update(primaryKeys, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] primaryKeys, string[] columnNames, object[] values)
        {
            return this.adapter.Update(primaryKeys, columnNames, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] primaryKeys, Dictionary<string, object> values)
        {
            return this.adapter.Update(primaryKeys, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="originalValues">The original values.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(string[] columnNames, object[] originalValues, object[] values)
        {
            return this.adapter.Update(columnNames, originalValues, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="originalValues">The original values.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(Dictionary<string, object> originalValues, Dictionary<string, object> values)
        {
            return this.adapter.Update(originalValues, values);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// pay attention to the parameter name.
        /// </remarks>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(CommonCommand conditionCommand, object[] values)
        {
            return this.adapter.Update(conditionCommand, values);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// pay attention to the parameter name.
        /// </remarks>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(CommonCommand conditionCommand, string[] columnNames, object[] values)
        {
            return this.adapter.Update(conditionCommand, columnNames, values);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// pay attention to the parameter name.
        /// </remarks>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(CommonCommand conditionCommand, Dictionary<string, object> values)
        {
            return this.adapter.Update(conditionCommand, values);
        }

        #region Normal Functions
        /// <summary>
        /// Gets The count of data rows.
        /// </summary>
        /// <returns>The count of data rows.</returns>
        public virtual int GetDataCount()
        {
            return this.adapter.GetDataCount();
        }

        /// <summary>
        /// Gets the data row count according the condition.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>The count of data rows.</returns>
        public virtual int GetDataCount(CommonCommand conditionCommand)
        {
            return this.adapter.GetDataCount(conditionCommand);
        }

        /// <summary>
        /// Gets the sum of data.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetSumData(string columnName)
        {
            return this.adapter.GetSumData(columnName);
        }

        /// <summary>
        /// Gets the sum of data according the condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetSumData(string columnName, CommonCommand conditionCommand)
        {
            return this.adapter.GetSumData(columnName, conditionCommand);
        }

        /// <summary>
        /// Gets the avg of data.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetAvgData(string columnName)
        {
            return this.adapter.GetAvgData(columnName);
        }

        /// <summary>
        /// Gets the avg of data according the condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetAvgData(string columnName, CommonCommand conditionCommand)
        {
            return this.adapter.GetAvgData(columnName, conditionCommand);
        }

        /// <summary>
        /// Gets the max of data.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetMaxData(string columnName)
        {
            return this.adapter.GetMaxData(columnName);
        }

        /// <summary>
        /// Get the max of data according condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetMaxData(string columnName, CommonCommand conditionCommand)
        {
            return this.adapter.GetMaxData(columnName, conditionCommand);
        }

        /// <summary>
        /// Gets the min of data.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetMinData(string columnName)
        {
            return this.adapter.GetMinData(columnName);
        }

        /// <summary>
        /// Get the min of data according condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetMinData(string columnName, CommonCommand conditionCommand)
        {
            return this.adapter.GetMinData(columnName, conditionCommand);
        }
        #endregion

        /// <summary>
        /// Check the data by primary key.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <returns>If exists then return true, otherwise return false.</returns>
        public virtual bool Exists(object[] primaryKeys)
        {
            return this.adapter.Exists(primaryKeys);
        }

        /// <summary>
        /// Save data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Save(object[] values)
        {
            return this.adapter.Save(values);
        }

        #region 并发冲突及Update 行为
        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, bool checkConcurrency)
        {
            return this.adapter.Update(dataTable, checkConcurrency, UpdateBehavior.Standard);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, string[] columnNames, bool checkConcurrency)
        {
            return this.adapter.Update(dataTable, columnNames, checkConcurrency, UpdateBehavior.Standard);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, bool checkConcurrency)
        {
            return this.adapter.Update(dataRows, checkConcurrency, UpdateBehavior.Standard);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, string[] columnNames, bool checkConcurrency)
        {
            return this.adapter.Update(dataRows, columnNames, checkConcurrency, UpdateBehavior.Standard);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, bool checkConcurrency)
        {
            return this.adapter.Update(dataRow, checkConcurrency);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, string[] columnNames, bool checkConcurrency)
        {
            return this.adapter.Update(dataRow, columnNames, checkConcurrency);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataTable, updateBehavior);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, string[] columnNames, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataTable, columnNames, updateBehavior);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataRows, updateBehavior);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, string[] columnNames, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataRows, columnNames, updateBehavior);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, bool checkConcurrency, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataTable, updateBehavior);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, string[] columnNames, bool checkConcurrency, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataTable, columnNames, checkConcurrency, updateBehavior);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, bool checkConcurrency, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataRows, checkConcurrency, updateBehavior);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, string[] columnNames, bool checkConcurrency, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataRows, columnNames, checkConcurrency, updateBehavior);
        }
        #endregion

        #region 自definition adapter 
        /// <summary>
        /// Create DataAdapter.
        /// </summary>
        /// <param name="selectCommand">Condition Command.</param>
        /// <returns>DataAdapter.</returns>
        public virtual System.Data.IDbDataAdapter CreateDataAdapter(CommonCommand selectCommand)
        {
            return this.adapter.CreateDataAdapter(selectCommand);
        }

        /// <summary>
        /// Create DataAdapter.
        /// </summary>
        /// <param name="selectCommand">Condition Command.</param>
        /// <param name="insertCommand">Insert command.</param>
        /// <param name="updateCommand">Update command.</param>
        /// <param name="deleteCommand">Delete command.</param>
        /// <returns>DataAdapter.</returns>
        public virtual System.Data.IDbDataAdapter CreateDataAdapter(CommonCommand selectCommand, CommonCommand insertCommand, CommonCommand updateCommand, CommonCommand deleteCommand)
        {
            return this.adapter.CreateDataAdapter(selectCommand, insertCommand, updateCommand, deleteCommand);
        }


        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="selectCommand">select Command.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillDataTable(System.Data.DataTable dataTable, CommonCommand selectCommand)
        {
            return this.adapter.FillDataTable(dataTable, selectCommand);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="selectCommand">select Command.</param>
        /// <returns>Datatable.</returns>
        public virtual T ExecuteDataTable(CommonCommand selectCommand)
        {
            return (T)this.adapter.ExecuteDataTable(selectCommand);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="insertCommand">Insert command.</param>
        /// <param name="updateCommand">Update command.</param>
        /// <param name="deleteCommand">Delete command.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateDataTable(System.Data.DataTable dataTable, CommonCommand insertCommand, CommonCommand updateCommand, CommonCommand deleteCommand)
        {
            return this.adapter.UpdateDataTable(dataTable, insertCommand, updateCommand, deleteCommand);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="insertCommand">Insert command.</param>
        /// <param name="updateCommand">Update command.</param>
        /// <param name="deleteCommand">Delete command.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateDataTable(System.Data.DataTable dataTable, CommonCommand insertCommand, CommonCommand updateCommand, CommonCommand deleteCommand, UpdateBehavior updateBehavior)
        {
            return this.adapter.UpdateDataTable(dataTable, insertCommand, updateCommand, deleteCommand, updateBehavior);
        }
        #endregion

        #region Paging Operation 
        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, int startRecord, int maxRecords)
        {
            return this.adapter.Fill(dataTable, startRecord, maxRecords);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, string[] columnNames, int startRecord, int maxRecords)
        {
            return this.adapter.Fill(dataTable, columnNames, startRecord, maxRecords);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, CommonCommand conditionCommand, int startRecord, int maxRecords)
        {
            return this.adapter.Fill(dataTable, conditionCommand, startRecord, maxRecords);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords)
        {
            return this.adapter.Fill(dataTable, columnNames, startRecord, maxRecords);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetData(startRecord, maxRecords);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(string[] columnNames, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetData(columnNames, startRecord, maxRecords);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(CommonCommand conditionCommand, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetData(conditionCommand, startRecord, maxRecords);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetData(columnNames, conditionCommand, startRecord, maxRecords);
        }
        #endregion

        #region View Mode
        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(CommonCommand conditionCommand)
        {
            return (T)this.adapter.GetViewData(conditionCommand);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(string[] columnNames, CommonCommand conditionCommand)
        {
            return (T)this.adapter.GetViewData(columnNames, conditionCommand);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, CommonCommand conditionCommand)
        {
            return this.adapter.FillView(dataTable, conditionCommand);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, string[] columnNames, CommonCommand conditionCommand)
        {
            return this.adapter.FillView(dataTable, columnNames, conditionCommand);
        }

        #region Normal Functions
        /// <summary>
        /// Gets the data row count according the condition.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>The count of data rows.</returns>
        public virtual int GetViewDataCount(CommonCommand conditionCommand)
        {
            return this.adapter.GetViewDataCount(conditionCommand);
        }

        /// <summary>
        /// Gets the sum of data according the condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetViewSumData(string columnName, CommonCommand conditionCommand)
        {
            return this.adapter.GetViewSumData(columnName, conditionCommand);
        }

        /// <summary>
        /// Gets the avg of data according the condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetViewAvgData(string columnName, CommonCommand conditionCommand)
        {
            return this.adapter.GetViewAvgData(columnName, conditionCommand);
        }

        /// <summary>
        /// Get the max of data according condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetViewMaxData(string columnName, CommonCommand conditionCommand)
        {
            return this.adapter.GetViewMaxData(columnName, conditionCommand);
        }

        /// <summary>
        /// Get the min of data according condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetViewMinData(string columnName, CommonCommand conditionCommand)
        {
            return this.adapter.GetViewMinData(columnName, conditionCommand);
        }
        #endregion

        #region Paging Operation 
        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(CommonCommand conditionCommand, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetViewData(conditionCommand, startRecord, maxRecords);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetViewData(columnNames, conditionCommand, startRecord, maxRecords);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, CommonCommand conditionCommand, int startRecord, int maxRecords)
        {
            return this.adapter.FillView(dataTable, conditionCommand, startRecord, maxRecords);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords)
        {
            return this.adapter.FillView(dataTable, columnNames, conditionCommand, startRecord, maxRecords);
        }
        #endregion
        #endregion
        #endregion
        #region Transaction
        #region Base Function 
        /// <summary>
        /// Execute SQL command.
        /// </summary>
        /// <param name="commonCommand">Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows affected.</returns>
        public virtual int ExecuteNonQueryCommand(CommonCommand commonCommand, string transactionID)
        {
            return this.adapter.ExecuteNonQueryCommand(commonCommand, transactionID);
        }

        /// <summary>
        /// Executes the query, and returns the first column of the first row in the result set returned by the query. Additional columns or rows are ignored.
        /// </summary>
        /// <param name="commonCommand">Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The first column of the first row in the result set, or a null reference (Nothing in Visual Basic) if the result set is empty.</returns>
        public virtual object ExecuteScalarCommand(CommonCommand commonCommand, string transactionID)
        {
            return this.adapter.ExecuteScalarCommand(commonCommand, transactionID);
        }

        /// <summary>
        /// Execute the Command to the Connection and builds a DbDataReader.
        /// </summary>
        /// <param name="commonCommand">Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>A DbDataReader object.</returns>
        public virtual System.Data.IDataReader ExecuteReaderCommand(CommonCommand commonCommand, string transactionID)
        {
            return this.adapter.ExecuteReaderCommand(commonCommand, transactionID);
        }
        #endregion

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, string transactionID)
        {
            return this.adapter.Fill(dataTable, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, string[] columnNames, string transactionID)
        {
            return this.adapter.Fill(dataTable, columnNames, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.Fill(dataTable, conditionCommand, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, string[] columnNames, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.Fill(dataTable, columnNames, conditionCommand, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, object[] primaryKeys, string transactionID)
        {
            return this.adapter.Fill(dataTable, primaryKeys, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, object[] primaryKeys, string[] columnNames, string transactionID)
        {
            return this.adapter.Fill(dataTable, primaryKeys, columnNames, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(string transactionID)
        {
            return (T)this.adapter.GetData(transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(string[] columnNames, string transactionID)
        {
            return (T)this.adapter.GetData(columnNames, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(CommonCommand conditionCommand, string transactionID)
        {
            return (T)this.adapter.GetData(conditionCommand, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(string[] columnNames, CommonCommand conditionCommand, string transactionID)
        {
            return (T)this.adapter.GetData(columnNames, conditionCommand, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(object[] primaryKeys, string transactionID)
        {
            return (T)this.adapter.GetData(primaryKeys, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(object[] primaryKeys, string[] columnNames, string transactionID)
        {
            return (T)this.adapter.GetData(primaryKeys, columnNames, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, string transactionID)
        {
            return this.adapter.Update(dataTable, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, string[] columnNames, string transactionID)
        {
            return this.adapter.Update(dataTable, columnNames, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, string transactionID)
        {
            return this.adapter.Update(dataRows, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, string[] columnNames, string transactionID)
        {
            return this.adapter.Update(dataRows, columnNames, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, string transactionID)
        {
            return this.adapter.Update(dataRow, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, string[] columnNames, string transactionID)
        {
            return this.adapter.Update(dataRow, columnNames, transactionID);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(object[] primaryKeys, string transactionID)
        {
            return this.adapter.Delete(primaryKeys, transactionID);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="originalValues">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(string[] columnNames, object[] originalValues, string transactionID)
        {
            return this.adapter.Delete(columnNames, originalValues, transactionID);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="originalValues">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(Dictionary<string, object> originalValues, string transactionID)
        {
            return this.adapter.Delete(originalValues, transactionID);
        }

        /// <summary>
        /// Delete the data according the condition.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.Delete(conditionCommand, transactionID);
        }

        /// <summary>
        /// Delete all data.
        /// </summary>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(string transactionID)
        {
            return this.adapter.Delete(transactionID);
        }

        /// <summary>
        /// Insert data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Insert(object[] values, string transactionID)
        {
            return this.adapter.Insert(values, transactionID);
        }

        /// <summary>
        /// Insert data.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Insert(string[] columnNames, object[] values, string transactionID)
        {
            return this.adapter.Insert(columnNames, values, transactionID);
        }

        /// <summary>
        /// Insert data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Insert(Dictionary<string, object> values, string transactionID)
        {
            return this.adapter.Insert(values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] values, string transactionID)
        {
            return this.adapter.Update(values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(string[] columnNames, object[] values, string transactionID)
        {
            return this.adapter.Update(columnNames, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(Dictionary<string, object> values, string transactionID)
        {
            return this.adapter.Update(values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] primaryKeys, object[] values, string transactionID)
        {
            return this.adapter.Update(primaryKeys, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] primaryKeys, string[] columnNames, object[] values, string transactionID)
        {
            return this.adapter.Update(primaryKeys, columnNames, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] primaryKeys, Dictionary<string, object> values, string transactionID)
        {
            return this.adapter.Update(primaryKeys, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="originalValues">The original values.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(string[] columnNames, object[] originalValues, object[] values, string transactionID)
        {
            return this.adapter.Update(columnNames, originalValues, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="originalValues">The original values.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(Dictionary<string, object> originalValues, Dictionary<string, object> values, string transactionID)
        {
            return this.adapter.Update(originalValues, values, transactionID);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// pay attention to the parameter name.
        /// </remarks>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(CommonCommand conditionCommand, object[] values, string transactionID)
        {
            return this.adapter.Update(conditionCommand, values, transactionID);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// pay attention to the parameter name.
        /// </remarks>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(CommonCommand conditionCommand, string[] columnNames, object[] values, string transactionID)
        {
            return this.adapter.Update(conditionCommand, columnNames, values, transactionID);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// pay attention to the parameter name.
        /// </remarks>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(CommonCommand conditionCommand, Dictionary<string, object> values, string transactionID)
        {
            return this.adapter.Update(conditionCommand, values, transactionID);
        }

        #region Normal Functions
        /// <summary>
        /// Gets The count of data rows.
        /// </summary>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of data rows.</returns>
        public virtual int GetDataCount(string transactionID)
        {
            return this.adapter.GetDataCount(transactionID);
        }

        /// <summary>
        /// Gets the data row count according the condition.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of data rows.</returns>
        public virtual int GetDataCount(CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetDataCount(conditionCommand, transactionID);
        }

        /// <summary>
        /// Gets the sum of data.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetSumData(string columnName, string transactionID)
        {
            return this.adapter.GetSumData(columnName, transactionID);
        }

        /// <summary>
        /// Gets the sum of data according the condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetSumData(string columnName, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetSumData(columnName, conditionCommand, transactionID);
        }

        /// <summary>
        /// Gets the avg of data.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetAvgData(string columnName, string transactionID)
        {
            return this.adapter.GetAvgData(columnName, transactionID);
        }

        /// <summary>
        /// Gets the avg of data according the condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetAvgData(string columnName, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetAvgData(columnName, conditionCommand, transactionID);
        }

        /// <summary>
        /// Gets the max of data.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetMaxData(string columnName, string transactionID)
        {
            return this.adapter.GetMaxData(columnName, transactionID);
        }

        /// <summary>
        /// Get the max of data according condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetMaxData(string columnName, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetMaxData(columnName, conditionCommand, transactionID);
        }

        /// <summary>
        /// Gets the min of data.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetMinData(string columnName, string transactionID)
        {
            return this.adapter.GetMinData(columnName, transactionID);
        }

        /// <summary>
        /// Get the min of data according condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetMinData(string columnName, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetMinData(columnName, conditionCommand, transactionID);
        }
        #endregion

        /// <summary>
        /// Check the data by primary key.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>If exists then return true, otherwise return false.</returns>
        public virtual bool Exists(object[] primaryKeys, string transactionID)
        {
            return this.adapter.Exists(primaryKeys, transactionID);
        }

        /// <summary>
        /// Save data.
        /// </summary>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Save(object[] values, string transactionID)
        {
            return this.adapter.Save(values, transactionID);
        }

        #region 并发冲突及Update 行为
        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, bool checkConcurrency, string transactionID)
        {
            return this.adapter.Update(dataTable, checkConcurrency, UpdateBehavior.Standard, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, string[] columnNames, bool checkConcurrency, string transactionID)
        {
            return this.adapter.Update(dataTable, columnNames, checkConcurrency, UpdateBehavior.Standard, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, bool checkConcurrency, string transactionID)
        {
            return this.adapter.Update(dataRows, checkConcurrency, UpdateBehavior.Standard, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, string[] columnNames, bool checkConcurrency, string transactionID)
        {
            return this.adapter.Update(dataRows, columnNames, checkConcurrency, UpdateBehavior.Standard, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, bool checkConcurrency, string transactionID)
        {
            return this.adapter.Update(dataRow, checkConcurrency, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, string[] columnNames, bool checkConcurrency, string transactionID)
        {
            return this.adapter.Update(dataRow, columnNames, checkConcurrency, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataTable, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, string[] columnNames, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataTable, columnNames, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataRows, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, string[] columnNames, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataRows, columnNames, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, bool checkConcurrency, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataTable, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, string[] columnNames, bool checkConcurrency, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataTable, columnNames, checkConcurrency, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, bool checkConcurrency, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataRows, checkConcurrency, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, string[] columnNames, bool checkConcurrency, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataRows, columnNames, checkConcurrency, updateBehavior, transactionID);
        }
        #endregion

        #region 自definition adapter 
        /// <summary>
        /// Create DataAdapter.
        /// </summary>
        /// <param name="selectCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>DataAdapter.</returns>
        public virtual System.Data.IDbDataAdapter CreateDataAdapter(CommonCommand selectCommand, string transactionID)
        {
            return this.adapter.CreateDataAdapter(selectCommand, transactionID);
        }

        /// <summary>
        /// Create DataAdapter.
        /// </summary>
        /// <param name="selectCommand">Condition Command.</param>
        /// <param name="insertCommand">Insert command.</param>
        /// <param name="updateCommand">Update command.</param>
        /// <param name="deleteCommand">Delete command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>DataAdapter.</returns>
        public virtual System.Data.IDbDataAdapter CreateDataAdapter(CommonCommand selectCommand, CommonCommand insertCommand, CommonCommand updateCommand, CommonCommand deleteCommand, string transactionID)
        {
            return this.adapter.CreateDataAdapter(selectCommand, insertCommand, updateCommand, deleteCommand, transactionID);
        }


        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="selectCommand">select Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillDataTable(System.Data.DataTable dataTable, CommonCommand selectCommand, string transactionID)
        {
            return this.adapter.FillDataTable(dataTable, selectCommand, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="selectCommand">select Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T ExecuteDataTable(CommonCommand selectCommand, string transactionID)
        {
            return (T)this.adapter.ExecuteDataTable(selectCommand, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="insertCommand">Insert command.</param>
        /// <param name="updateCommand">Update command.</param>
        /// <param name="deleteCommand">Delete command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateDataTable(System.Data.DataTable dataTable, CommonCommand insertCommand, CommonCommand updateCommand, CommonCommand deleteCommand, string transactionID)
        {
            return this.adapter.UpdateDataTable(dataTable, insertCommand, updateCommand, deleteCommand, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="insertCommand">Insert command.</param>
        /// <param name="updateCommand">Update command.</param>
        /// <param name="deleteCommand">Delete command.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateDataTable(System.Data.DataTable dataTable, CommonCommand insertCommand, CommonCommand updateCommand, CommonCommand deleteCommand, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.UpdateDataTable(dataTable, insertCommand, updateCommand, deleteCommand, updateBehavior, transactionID);
        }
        #endregion

        #region Paging Operation 
        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.Fill(dataTable, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, string[] columnNames, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.Fill(dataTable, columnNames, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.Fill(dataTable, conditionCommand, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.Fill(dataTable, columnNames, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetData(startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(string[] columnNames, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetData(columnNames, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetData(conditionCommand, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetData(columnNames, conditionCommand, startRecord, maxRecords, transactionID);
        }
        #endregion

        #region View Mode
        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(CommonCommand conditionCommand, string transactionID)
        {
            return (T)this.adapter.GetViewData(conditionCommand, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(string[] columnNames, CommonCommand conditionCommand, string transactionID)
        {
            return (T)this.adapter.GetViewData(columnNames, conditionCommand, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.FillView(dataTable, conditionCommand, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, string[] columnNames, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.FillView(dataTable, columnNames, conditionCommand, transactionID);
        }

        #region Normal Functions
        /// <summary>
        /// Gets the data row count according the condition.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of data rows.</returns>
        public virtual int GetViewDataCount(CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetViewDataCount(conditionCommand, transactionID);
        }

        /// <summary>
        /// Gets the sum of data according the condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetViewSumData(string columnName, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetViewSumData(columnName, conditionCommand, transactionID);
        }

        /// <summary>
        /// Gets the avg of data according the condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetViewAvgData(string columnName, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetViewAvgData(columnName, conditionCommand, transactionID);
        }

        /// <summary>
        /// Get the max of data according condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetViewMaxData(string columnName, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetViewMaxData(columnName, conditionCommand, transactionID);
        }

        /// <summary>
        /// Get the min of data according condition.
        /// </summary>
        /// <param name="columnName">Column name.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetViewMinData(string columnName, CommonCommand conditionCommand, string transactionID)
        {
            return this.adapter.GetViewMinData(columnName, conditionCommand, transactionID);
        }
        #endregion

        #region Paging Operation 
        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetViewData(conditionCommand, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetViewData(columnNames, conditionCommand, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.FillView(dataTable, conditionCommand, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnNames">An array of Columns.</param>
        /// <param name="conditionCommand">Condition Command.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, string[] columnNames, CommonCommand conditionCommand, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.FillView(dataTable, columnNames, conditionCommand, startRecord, maxRecords, transactionID);
        }
        #endregion
        #endregion
        #endregion

        #region Extension Functions
        #region Common Methods
        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression)
        {
            return this.adapter.Fill(dataTable, conditionExpression);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression)
        {
            return this.adapter.Fill(dataTable, columnExpressions, conditionExpression);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillByPrimaryKey(System.Data.DataTable dataTable, object primaryKey)
        {
            return this.adapter.FillByPrimaryKey(dataTable, primaryKey);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillByPrimaryKey(System.Data.DataTable dataTable, object primaryKey, ColumnExpression[] columnExpressions)
        {
            return this.adapter.FillByPrimaryKey(dataTable, primaryKey, columnExpressions);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression)
        {
            return (T)this.adapter.GetData(conditionExpression);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression)
        {
            return (T)this.adapter.GetData(columnExpressions, conditionExpression);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetDataByPrimaryKey(object primaryKey)
        {
            return (T)this.adapter.GetDataByPrimaryKey(primaryKey);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetDataByPrimaryKey(object primaryKey, ColumnExpression[] columnExpressions)
        {
            return (T)this.adapter.GetDataByPrimaryKey(primaryKey, columnExpressions);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int DeleteByPrimaryKey(object primaryKey)
        {
            return this.adapter.DeleteByPrimaryKey(primaryKey);
        }

        /// <summary>
        /// Delete the data according the condition.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression)
        {
            return this.adapter.Delete(conditionExpression);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateByPrimaryKey(object primaryKey, object[] values)
        {
            return this.adapter.UpdateByPrimaryKey(primaryKey, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateByPrimaryKey(object primaryKey, ColumnExpression[] columnExpressions, object[] values)
        {            
            return this.adapter.UpdateByPrimaryKey(primaryKey, columnExpressions, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateByPrimaryKey(object primaryKey, Dictionary<string, object> values)
        {
            return this.adapter.UpdateByPrimaryKey(primaryKey, values);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// Pay attention to the parameter name in the addtion condtion.
        /// </remarks>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, object[] values)
        {
            return this.adapter.Update(conditionExpression, values);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// Pay attention to the parameter name in the addtion condtion.
        /// </remarks>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, ColumnExpression[] columnExpressions, object[] values)
        {
            return this.adapter.Update(conditionExpression, columnExpressions, values);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// Pay attention to the parameter name in the addtion condtion.
        /// </remarks>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, Dictionary<string, object> values)
        {
            return this.adapter.Update(conditionExpression, values);
        }

        /// <summary>
        /// Check the data by primary key.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <returns>If exists then return true, otherwise return false.</returns>
        public virtual bool ExistsByPrimaryKey(object primaryKey)
        {
            return this.adapter.ExistsByPrimaryKey(primaryKey);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, RaisingStudio.Data.Expressions.ColumnExpression[] columnExpressions)
        {
            return this.adapter.Fill(dataTable, columnExpressions);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, object[] primaryKeys, ColumnExpression[] columnExpressions)
        {
            return this.adapter.Fill(dataTable, primaryKeys, columnExpressions);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ColumnExpression[] columnExpressions)
        {
            return (T)this.adapter.GetData(columnExpressions);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(object[] primaryKeys, ColumnExpression[] columnExpressions)
        {
            return (T)this.adapter.GetData(primaryKeys, columnExpressions);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions)
        {
            return this.adapter.Update(dataTable, columnExpressions);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, ColumnExpression[] columnExpressions)
        {
            return this.adapter.Update(dataRows, columnExpressions);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, ColumnExpression[] columnExpressions)
        {
            return this.adapter.Update(dataRow, columnExpressions);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="originalValues">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(ColumnExpression[] columnExpressions, object[] originalValues)
        {
            return this.adapter.Delete(columnExpressions, originalValues);
        }

        /// <summary>
        /// Insert data.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Insert(ColumnExpression[] columnExpressions, object[] values)
        {
            return this.adapter.Insert(columnExpressions, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(ColumnExpression[] columnExpressions, object[] values)
        {
            return this.adapter.Update(columnExpressions, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] primaryKeys, ColumnExpression[] columnExpressions, object[] values)
        {
            return this.adapter.Update(primaryKeys, columnExpressions, values);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="originalValues">The original values.</param>
        /// <param name="values">values.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(ColumnExpression[] columnExpressions, object[] originalValues, object[] values)
        {
            return this.adapter.Update(columnExpressions, originalValues, values);
        }

        #region Normal Functions
        /// <summary>
        /// Gets the data row count according the condition.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>The count of data rows.</returns>
        public virtual int GetDataCount(ConditionExpression conditionExpression)
        {
            return this.adapter.GetDataCount(conditionExpression);
        }

        /// <summary>
        /// Gets the sum of data.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetSumData(ColumnExpression columnExpression)
        {
            return this.adapter.GetSumData(columnExpression);
        }

        /// <summary>
        /// Gets the sum of data according the condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetSumData(ColumnExpression columnExpression, ConditionExpression conditionExpression)
        {
            return this.adapter.GetSumData(columnExpression, conditionExpression);
        }

        /// <summary>
        /// Gets the avg of data.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetAvgData(ColumnExpression columnExpression)
        {
            return this.adapter.GetAvgData(columnExpression);
        }

        /// <summary>
        /// Gets the avg of data according the condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetAvgData(ColumnExpression columnExpression, ConditionExpression conditionExpression)
        {
            return this.adapter.GetAvgData(columnExpression, conditionExpression);
        }

        /// <summary>
        /// Gets the max of data.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetMaxData(ColumnExpression columnExpression)
        {
            return this.adapter.GetMaxData(columnExpression);
        }

        /// <summary>
        /// Get the max of data according condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the max of data.</returns>
        public virtual object GetMaxData(ColumnExpression columnExpression, ConditionExpression conditionExpression)
        {
            return this.adapter.GetMaxData(columnExpression, conditionExpression);
        }

        /// <summary>
        /// Gets the min of data.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetMinData(ColumnExpression columnExpression)
        {
            return this.adapter.GetMinData(columnExpression);
        }

        /// <summary>
        /// Get the min of data according condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the min of data.</returns>
        public virtual object GetMinData(ColumnExpression columnExpression, ConditionExpression conditionExpression)
        {
            return this.adapter.GetMinData(columnExpression, conditionExpression);
        }
        #endregion

        #region 并发冲突及Update 行为
        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, bool checkConcurrency)
        {
            return this.adapter.Update(dataTable, columnExpressions, checkConcurrency);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, ColumnExpression[] columnExpressions, bool checkConcurrency)
        {
            return this.adapter.Update(dataRows, columnExpressions, checkConcurrency);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, ColumnExpression[] columnExpressions, bool checkConcurrency)
        {
            return this.adapter.Update(dataRow, columnExpressions, checkConcurrency);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataTable, columnExpressions, updateBehavior);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, ColumnExpression[] columnExpressions, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataRows, columnExpressions, updateBehavior);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, bool checkConcurrency, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataTable, columnExpressions, checkConcurrency, updateBehavior);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, ColumnExpression[] columnExpressions, bool checkConcurrency, UpdateBehavior updateBehavior)
        {
            return this.adapter.Update(dataRows, columnExpressions, checkConcurrency, updateBehavior);
        }
        #endregion

        #region Paging Operation 
        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, int startRecord, int maxRecords)
        {
            return this.adapter.Fill(dataTable, columnExpressions, startRecord, maxRecords);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, ConditionExpression conditionExpression, int startRecord, int maxRecords)
        {
            return this.adapter.Fill(dataTable, conditionExpression, startRecord, maxRecords);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, int startRecord, int maxRecords)
        {            
            return this.adapter.Fill(dataTable, columnExpressions, startRecord, maxRecords);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ColumnExpression[] columnExpressions, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetData(columnExpressions, startRecord, maxRecords);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ConditionExpression conditionExpression, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetData(conditionExpression, startRecord, maxRecords);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetData(columnExpressions, conditionExpression, startRecord, maxRecords);
        }
        #endregion

        #region View Mode
        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(ConditionExpression conditionExpression)
        {
            return (T)this.adapter.GetViewData(conditionExpression);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(ColumnExpression[] columnExpressions, ConditionExpression conditionExpression)
        {
            return (T)this.adapter.GetViewData(columnExpressions, conditionExpression);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, ConditionExpression conditionExpression)
        {
            return this.adapter.FillView(dataTable, conditionExpression);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, ConditionExpression conditionExpression)
        {
            return this.adapter.FillView(dataTable, columnExpressions, conditionExpression);
        }

        #region Normal Functions
        /// <summary>
        /// Gets the data row count according the condition.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>The count of data rows.</returns>
        public virtual int GetViewDataCount(ConditionExpression conditionExpression)
        {
            return this.adapter.GetViewDataCount(conditionExpression);
        }

        /// <summary>
        /// Gets the sum of data according the condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetViewSumData(ColumnExpression columnExpression, ConditionExpression conditionExpression)
        {
            return this.adapter.GetViewSumData(columnExpression, conditionExpression);
        }

        /// <summary>
        /// Gets the avg of data according the condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetViewAvgData(ColumnExpression columnExpression, ConditionExpression conditionExpression)
        {
            return this.adapter.GetViewAvgData(columnExpression, conditionExpression);
        }

        /// <summary>
        /// Get the max of data according condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the max of data.</returns>
        public virtual object GetViewMaxData(ColumnExpression columnExpression, ConditionExpression conditionExpression)
        {
            return this.adapter.GetViewMaxData(columnExpression, conditionExpression);
        }

        /// <summary>
        /// Get the min of data according condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <returns>the min of data.</returns>
        public virtual object GetViewMinData(ColumnExpression columnExpression, ConditionExpression conditionExpression)
        {
            return this.adapter.GetViewMinData(columnExpression, conditionExpression);
        }
        #endregion

        #region Paging Operation 
        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(ConditionExpression conditionExpression, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetViewData(conditionExpression, startRecord, maxRecords);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, int startRecord, int maxRecords)
        {
            return (T)this.adapter.GetViewData(columnExpressions, conditionExpression, startRecord, maxRecords);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, ConditionExpression conditionExpression, int startRecord, int maxRecords)
        {
            return this.adapter.FillView(dataTable, conditionExpression, startRecord, maxRecords);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, int startRecord, int maxRecords)
        {
            return this.adapter.FillView(dataTable, columnExpressions, conditionExpression, startRecord, maxRecords);
        }
        #endregion
        #endregion
        #endregion
        #region Transaction
        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.Fill(dataTable, conditionExpression, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.Fill(dataTable, columnExpressions, conditionExpression, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillByPrimaryKey(System.Data.DataTable dataTable, object primaryKey, string transactionID)
        {
            return this.adapter.FillByPrimaryKey(dataTable, primaryKey, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillByPrimaryKey(System.Data.DataTable dataTable, object primaryKey, ColumnExpression[] columnExpressions, string transactionID)
        {
            return this.adapter.FillByPrimaryKey(dataTable, primaryKey, columnExpressions, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID)
        {
            return (T)this.adapter.GetData(conditionExpression, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of Columns.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ColumnExpression[] columnExpressions, RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID)
        {
            return (T)this.adapter.GetData(columnExpressions, conditionExpression, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetDataByPrimaryKey(object primaryKey, string transactionID)
        {
            return (T)this.adapter.GetDataByPrimaryKey(primaryKey, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of Columns.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetDataByPrimaryKey(object primaryKey, ColumnExpression[] columnExpressions, string transactionID)
        {
            return (T)this.adapter.GetDataByPrimaryKey(primaryKey, columnExpressions, transactionID);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int DeleteByPrimaryKey(object primaryKey, string transactionID)
        {
            return this.adapter.DeleteByPrimaryKey(primaryKey, transactionID);
        }

        /// <summary>
        /// Delete the data according the condition.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.Delete(conditionExpression, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateByPrimaryKey(object primaryKey, object[] values, string transactionID)
        {
            return this.adapter.UpdateByPrimaryKey(primaryKey, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="columnExpressions">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateByPrimaryKey(object primaryKey, ColumnExpression[] columnExpressions, object[] values, string transactionID)
        {
            return this.adapter.UpdateByPrimaryKey(primaryKey, columnExpressions, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int UpdateByPrimaryKey(object primaryKey, Dictionary<string, object> values, string transactionID)
        {
            return this.adapter.UpdateByPrimaryKey(primaryKey, values, transactionID);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// Pay attention to the parameter name in the addtion condtion.
        /// </remarks>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, object[] values, string transactionID)
        {
            return this.adapter.Update(conditionExpression, values, transactionID);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// Pay attention to the parameter name in the addtion condtion.
        /// </remarks>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="columnExpressions">An array of Columns.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, ColumnExpression[] columnExpressions, object[] values, string transactionID)
        {
            return this.adapter.Update(conditionExpression, columnExpressions, values, transactionID);
        }

        /// <summary>
        /// Update the data according the condition.
        /// </summary>
        /// <remarks>
        /// Pay attention to the parameter name in the addtion condtion.
        /// </remarks>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(RaisingStudio.Data.Expressions.ConditionExpression conditionExpression, Dictionary<string, object> values, string transactionID)
        {
            return this.adapter.Update(conditionExpression, values, transactionID);
        }

        /// <summary>
        /// Check the data by primary key.
        /// </summary>
        /// <param name="primaryKey">The value of primary key.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>If exists then return true, otherwise return false.</returns>
        public virtual bool ExistsByPrimaryKey(object primaryKey, string transactionID)
        {            
            return this.adapter.ExistsByPrimaryKey(primaryKey, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, RaisingStudio.Data.Expressions.ColumnExpression[] columnExpressions, string transactionID)
        {
            return this.adapter.Fill(dataTable, columnExpressions, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, object[] primaryKeys, ColumnExpression[] columnExpressions, string transactionID)
        {
            return this.adapter.Fill(dataTable, primaryKeys, columnExpressions, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ColumnExpression[] columnExpressions, string transactionID)
        {
            return (T)this.adapter.GetData(columnExpressions, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(object[] primaryKeys, ColumnExpression[] columnExpressions, string transactionID)
        {
            return (T)this.adapter.GetData(primaryKeys, columnExpressions, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, string transactionID)
        {
            return this.adapter.Update(dataTable, columnExpressions, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, ColumnExpression[] columnExpressions, string transactionID)
        {
            return this.adapter.Update(dataRows, columnExpressions, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, ColumnExpression[] columnExpressions, string transactionID)
        {
            return this.adapter.Update(dataRow, columnExpressions, transactionID);
        }

        /// <summary>
        /// Delete data.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="originalValues">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Delete(ColumnExpression[] columnExpressions, object[] originalValues, string transactionID)
        {
            return this.adapter.Delete(columnExpressions, originalValues, transactionID);
        }

        /// <summary>
        /// Insert data.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Insert(ColumnExpression[] columnExpressions, object[] values, string transactionID)
        {
            return this.adapter.Insert(columnExpressions, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(ColumnExpression[] columnExpressions, object[] values, string transactionID)
        {
            return this.adapter.Update(columnExpressions, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="primaryKeys">The value of primary key.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(object[] primaryKeys, ColumnExpression[] columnExpressions, object[] values, string transactionID)
        {
            return this.adapter.Update(primaryKeys, columnExpressions, values, transactionID);
        }

        /// <summary>
        /// Update data.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="originalValues">The original values.</param>
        /// <param name="values">values.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(ColumnExpression[] columnExpressions, object[] originalValues, object[] values, string transactionID)
        {
            return this.adapter.Update(columnExpressions, originalValues, values, transactionID);
        }

        #region Normal Functions
        /// <summary>
        /// Gets the data row count according the condition.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of data rows.</returns>
        public virtual int GetDataCount(ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetDataCount(conditionExpression, transactionID);
        }

        /// <summary>
        /// Gets the sum of data.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetSumData(ColumnExpression columnExpression, string transactionID)
        {
            return this.adapter.GetSumData(columnExpression, transactionID);
        }

        /// <summary>
        /// Gets the sum of data according the condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetSumData(ColumnExpression columnExpression, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetSumData(columnExpression, conditionExpression, transactionID);
        }

        /// <summary>
        /// Gets the avg of data.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetAvgData(ColumnExpression columnExpression, string transactionID)
        {
            return this.adapter.GetAvgData(columnExpression, transactionID);
        }

        /// <summary>
        /// Gets the avg of data according the condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetAvgData(ColumnExpression columnExpression, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetAvgData(columnExpression, conditionExpression, transactionID);
        }

        /// <summary>
        /// Gets the max of data.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetMaxData(ColumnExpression columnExpression, string transactionID)
        {
            return this.adapter.GetMaxData(columnExpression, transactionID);
        }

        /// <summary>
        /// Get the max of data according condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetMaxData(ColumnExpression columnExpression, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetMaxData(columnExpression, conditionExpression, transactionID);
        }

        /// <summary>
        /// Gets the min of data.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetMinData(ColumnExpression columnExpression, string transactionID)
        {
            return this.adapter.GetMinData(columnExpression, transactionID);
        }

        /// <summary>
        /// Get the min of data according condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetMinData(ColumnExpression columnExpression, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetMinData(columnExpression, conditionExpression, transactionID);
        }
        #endregion

        #region 并发冲突及Update 行为
        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, bool checkConcurrency, string transactionID)
        {
            return this.adapter.Update(dataTable, columnExpressions, checkConcurrency, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, ColumnExpression[] columnExpressions, bool checkConcurrency, string transactionID)
        {
            return this.adapter.Update(dataRows, columnExpressions, checkConcurrency, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRow">Datarow.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow dataRow, ColumnExpression[] columnExpressions, bool checkConcurrency, string transactionID)
        {
            return this.adapter.Update(dataRow, columnExpressions, checkConcurrency, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataTable, columnExpressions, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, ColumnExpression[] columnExpressions, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataRows, columnExpressions, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, bool checkConcurrency, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataTable, columnExpressions, checkConcurrency, updateBehavior, transactionID);
        }

        /// <summary>
        /// Update Datarow.
        /// </summary>
        /// <param name="dataRows">Array of DataRows.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="checkConcurrency">Check concurrency.</param>
        /// <param name="updateBehavior">Update behavior</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of rows that updated.</returns>
        public virtual int Update(System.Data.DataRow[] dataRows, ColumnExpression[] columnExpressions, bool checkConcurrency, UpdateBehavior updateBehavior, string transactionID)
        {
            return this.adapter.Update(dataRows, columnExpressions, checkConcurrency, updateBehavior, transactionID);
        }
        #endregion

        #region Paging Operation 
        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.Fill(dataTable, columnExpressions, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.Fill(dataTable, conditionExpression, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int Fill(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.Fill(dataTable, columnExpressions, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ColumnExpression[] columnExpressions, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetData(columnExpressions, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetData(conditionExpression, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetData(ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetData(columnExpressions, conditionExpression, startRecord, maxRecords, transactionID);
        }
        #endregion

        #region View Mode
        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(ConditionExpression conditionExpression, string transactionID)
        {
            return (T)this.adapter.GetViewData(conditionExpression, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, string transactionID)
        {
            return (T)this.adapter.GetViewData(columnExpressions, conditionExpression, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.FillView(dataTable, conditionExpression, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.FillView(dataTable, columnExpressions, conditionExpression, transactionID);
        }

        #region Normal Functions
        /// <summary>
        /// Gets the data row count according the condition.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The count of data rows.</returns>
        public virtual int GetViewDataCount(ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetViewDataCount(conditionExpression, transactionID);
        }

        /// <summary>
        /// Gets the sum of data according the condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the sum of data.</returns>
        public virtual object GetViewSumData(ColumnExpression columnExpression, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetViewSumData(columnExpression, conditionExpression, transactionID);
        }

        /// <summary>
        /// Gets the avg of data according the condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the avg of data.</returns>
        public virtual object GetViewAvgData(ColumnExpression columnExpression, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetViewAvgData(columnExpression, conditionExpression, transactionID);
        }

        /// <summary>
        /// Get the max of data according condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the max of data.</returns>
        public virtual object GetViewMaxData(ColumnExpression columnExpression, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetViewMaxData(columnExpression, conditionExpression, transactionID);
        }

        /// <summary>
        /// Get the min of data according condition.
        /// </summary>
        /// <param name="columnExpression">Column expression.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>the min of data.</returns>
        public virtual object GetViewMinData(ColumnExpression columnExpression, ConditionExpression conditionExpression, string transactionID)
        {
            return this.adapter.GetViewMinData(columnExpression, conditionExpression, transactionID);
        }
        #endregion

        #region Paging Operation 
        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetViewData(conditionExpression, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// Gets Datatable.
        /// </summary>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>Datatable.</returns>
        public virtual T GetViewData(ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID)
        {
            return (T)this.adapter.GetViewData(columnExpressions, conditionExpression, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.FillView(dataTable, conditionExpression, startRecord, maxRecords, transactionID);
        }

        /// <summary>
        /// FillDatatable.
        /// </summary>
        /// <param name="dataTable">Datatable.</param>
        /// <param name="columnExpressions">An array of column expressions.</param>
        /// <param name="conditionExpression">Condition expression</param>
        /// <param name="startRecord">The zero-based record number to start with. </param>
        /// <param name="maxRecords">The maximum number of records to retrieve. </param>
        /// <param name="transactionID">The ID of transaction.</param>
        /// <returns>The number of rows successfully added to or refreshed. This does not include rows affected by statements that do not return rows.</returns>
        public virtual int FillView(System.Data.DataTable dataTable, ColumnExpression[] columnExpressions, ConditionExpression conditionExpression, int startRecord, int maxRecords, string transactionID)
        {
            return this.adapter.FillView(dataTable, columnExpressions, conditionExpression, startRecord, maxRecords, transactionID);
        }
        #endregion
        #endregion
        #endregion
        #endregion
    }
}